package api.app;

import org.json.JSONException;
import org.json.JSONObject;

import common.Host;
import common.Request;

/**
 * 实现帮忙医APP修改个人资料接口ApiUserModify调用
 * @author lipeng
 *
 */
public class ApiUserModify
{
	/**
	 * 
	 * @param base64photo -头像
	 * @param filename -文件名
	 * @param sex      -性别
	 * @param name     -姓名
	 * @param addition1 - 昵称
	 * @param UserAccount  -手机号
	 * @param Idcard    -身份证号码
	 * @return  接口返回数据
	 * @throws JSONException
	 * @throws Exception
	 */
  public static String post(String base64photo,String filename,String sex,String name,String addition1,String userAccount,String idcard)throws JSONException,Exception{
	  
	  //拼接口地址
	  String url = Host.getAddress() + "/APIAccount/ApiUserModify";
	  
	  //给接口参数赋值
	  JSONObject parms = new JSONObject();
	  parms.put("photo", base64photo);
	  parms.put("fileName", filename);
	  parms.put("sex", sex);
	  parms.put("Name", name);
	  parms.put("Addition1", addition1);
	  parms.put("Idcard", idcard);
	  parms.put("UserAccount", userAccount);	  
	  
	  //调用接口并放回参数结果
	  String result = Request.post(url, parms);
	  return result;
	  
  }
}
